package com.cskaoyan.mall.service;

import com.cskaoyan.mall.model.bo.order.AddCartOrderBo;
import com.cskaoyan.mall.model.bo.order.ChangeOrderBo;
import com.cskaoyan.mall.model.bo.order.CriticismBo;
import com.cskaoyan.mall.model.bo.order.OrderMessageBo;
import com.cskaoyan.mall.model.po.GoodsAndSpec;
import com.cskaoyan.mall.model.po.User;
import com.cskaoyan.mall.model.vo.order.*;

import java.util.List;

/**
 * @ClassName: OrderService
 * @Description: TODO
 * @Auther 庄左
 * @Date 2022/7/1 16:38
 * @Version
 **/
public interface OrderService {
    List<OrderMessageVo> selectOrderMessage(OrderMessageBo orderMessageBo);

    UserOrderMessageVo selectUserMessage(Integer id,Integer orderId);

    //查询所有
    List<OrderSpec> selectSpecList(Integer id);
    List<OrderStates> selectStateList();

    //查询当前
    CurSpec selectCurSpec(Integer id);
    CurState selectCurState(Integer id);

    OrderUpdate selectorderUpdate(Integer id);


    String selectStateById(Integer id);
    String selectSpecById(Integer id);
    void changeOrder(ChangeOrderBo changeOrderBo);

    void deleteOrder(Integer id);

    Integer selectGoodsIdByOrderId(Integer id);

    // CartGoodVo selectCartGoods(Integer orderId);
    List<CartOrderVo> selectCartOrderByStateId(Integer StateId,String name);



    //根据发货状态id，拿到发货状态stateValue 返回一个String
    String selectStateValueByStateId(Integer stateId);


    //根据规格id拿到 规格spec，商品id
    GoodsAndSpec selectGoodsIdAndSpecMessageBySpecId(Integer specId);
    //根据商品id拿到商品的名称和图片 goods img
    GoodsAndSpec selectGoodsMessageByGoodsId(Integer goodsId);

    //根据昵称拿到用户的id，用户名，收件人，地址，电话
    User selectUserMessageByUserNickName(String nikeName);

    //加入购物车
    void insertGoodsToCart(AddCartOrderBo addCartOrderBo,String state,GoodsAndSpec goodsAndSpec,GoodsAndSpec goodsAndSpec1,User user);
    //更新库存数量
    void updateStockNumInSpec(Integer stockNum, Integer specId);

    void updateOrderStateIdAndState();

    void updateOrderStateByOrderIdFromPay(Integer id);

   //=========================================================================//

    //写评论
    int insertCriticsm(CriticismBo criticismBo);

    String selectUserIdByUserNickName(String userNickName);


    int updateOrderHasComment(Integer id);

    //收货
    int updateOrderStateByOrderIdFromConfirmReceive(Integer id);
}
